package com.kingschan.jeasytag.tag.form;

import java.io.IOException;

import javax.servlet.jsp.JspException;
import com.kingschan.jeasytag.core.annotations.tag.*;
import com.kingschan.jeasytag.core.parse.TagParseFactory;
import com.kingschan.jeasytag.tag.RootTag;
/**
 * ���Ӱ�ť���ڴ��������Ӱ�ť�����Ǳ�ʾ���<a>��ǡ��������ʾͼ������֣���ֻͼ������֡��ð�ť�Ŀ�ȿ��Զ�̬����/չ��������Ӧ���ı���ǩ��
 * @author kingschan
 *date:2013-4-18
 */
@TagMetaData(CssClass = "easyui-linkbutton", tag = "a"
)
public class LinkButtonTag extends RootTag {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@BooleanField(description="����Ϊtrue�����ð�ť��")
	private String disabled;
	@BooleanField(description="����Ϊtrue����ʾ���Ч��")
	private String plain;
	
	private String text;
	@StringField(description="�����������ʾһ��16x16��Сͼ���css��")
	private String iconCls;
	@PropertyField
	@StringField(description="���ӵ�ַ")
	private String href;
	@PropertyField
	@StringField(description="�����¼�")
	private String onclick;
	
	
	@Override
	public int doStartTag() throws JspException {
		
		try {
			this.pageContext.getOut().write(TagParseFactory.executeParse(this,pageContext));
		} catch (Exception e) {		
			e.printStackTrace();
		}
		return super.doStartTag();
	}
	@Override
	public int doAfterBody() throws JspException {
		try {
			this.pageContext.getOut().write(this.getBodyContent().getString());
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return super.doAfterBody();
	}
	@Override
	public int doEndTag() throws JspException {
		try {
			this.pageContext.getOut().write("</a>");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return super.doEndTag();
	}
	
	
	
	public String getDisabled() {
		return disabled;
	}
	public void setDisabled(String disabled) {
		this.disabled = disabled;
	}
	public String getPlain() {
		return plain;
	}
	public void setPlain(String plain) {
		this.plain = plain;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public String getIconCls() {
		return iconCls;
	}
	public void setIconCls(String iconCls) {
		this.iconCls = iconCls;
	}
	public String getHref() {
		return href;
	}
	public void setHref(String href) {
		this.href = href;
	}
	public String getOnclick() {
		return onclick;
	}
	public void setOnclick(String onclick) {
		this.onclick = onclick;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
	
	
	
}
